module(
    name = "rules_img",
    version = "0.2.3",
    compatibility_level = 1,
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")

prebuilt_img_tool = use_extension("@rules_img//img/private/prebuilt:prebuilt.bzl", "prebuilt_img_tool")
prebuilt_img_tool.collection(
    name = "img_toolchain",
)
prebuilt_img_tool.from_file(
    collection = "img_toolchain",
    file = "@rules_img//:prebuilt_lockfile.json",
)
use_repo(
    prebuilt_img_tool,
    "img_toolchain",
)

# register a prebuilt toolchain of the img tool.
register_toolchains(
    "@img_toolchain//:all",
)

# ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
# only dev_dependencies below this line - rules_img is lean
# ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

bazel_dep(name = "aspect_bazel_lib", version = "2.20.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.45.0", dev_dependency = True)
bazel_dep(name = "hermetic_cc_toolchain", version = "4.0.1", dev_dependency = True)
bazel_dep(name = "rules_bazel_integration_test", version = "0.33.2", dev_dependency = True)
bazel_dep(name = "rules_go", version = "0.54.0", dev_dependency = True)
bazel_dep(name = "rules_img_tool", version = "0.2.3", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True)
bazel_dep(name = "rules_python", version = "1.6.1", dev_dependency = True)
bazel_dep(name = "tweag-credential-helper", version = "0.0.6", dev_dependency = True)

module_version = use_extension("//img/private/config:defs.bzl", "module_version", dev_dependency = True)
use_repo(module_version, "rules_img_version")

bazel_binaries = use_extension(
    "@rules_bazel_integration_test//:extensions.bzl",
    "bazel_binaries",
    dev_dependency = True,
)
bazel_binaries.download(version = "7.4.0")
bazel_binaries.download(version = "8.4.1")
use_repo(bazel_binaries, "bazel_binaries", "bazel_binaries_bazelisk", "build_bazel_bazel_7_4_0", "build_bazel_bazel_8_4_1")

go_sdk = use_extension(
    "@rules_go//go:extensions.bzl",
    "go_sdk",
    dev_dependency = True,
)
go_sdk.download(version = "1.24.2")

toolchains = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains", dev_dependency = True)
use_repo(toolchains, "zig_sdk")

register_toolchains(
    "@zig_sdk//toolchain:linux_amd64_musl",
    "@zig_sdk//toolchain:linux_arm64_musl",
    dev_dependency = True,
)
